package com.billow.book.utils;

import com.billow.book.model.vo.ResultVo;

public class ResultUtils {

    public static ResultVo buildSuccess() {
        ResultVo vo = new ResultVo();
        vo.setCode(0);
        vo.setData(null);
        vo.setMsg("SUCCESS");
        return vo;
    }

    public static ResultVo buildSuccess(Object data) {
        ResultVo vo = new ResultVo();
        vo.setCode(0);
        vo.setData(data);
        vo.setMsg("SUCCESS");
        return vo;
    }

    public static ResultVo buildFail(String msg) {
        ResultVo vo = new ResultVo<>();
        vo.setCode(-1);
        vo.setMsg(msg);
        return vo;
    }
}